<?php
	session_start();	
?>

<?php
	if( $_SESSION["admin"] != "" )
	{
?>

<?php
    include_once("process/order.php");
	$order = new order();
	
	if( $_GET["com"] == "order" && $_GET["func"] == "update" && isset($_GET["id"]))
	{
		$row = $order->GetOneOrder($_GET['id']);
         $id = $row['order_id'];
            if($row['order_status'] == 1)
            {
			     $order->UpdateOrder('0', $id);
            }
            else
            {
                $order->UpdateOrder('1', $id);
            }
         	echo '<meta http-equiv="Refresh" content="0;URL=index.php?com=order" />';
			return;
	}
	else
	{
		echo '<meta http-equiv="Refresh" content="0;URL=index.php?com=order" />';
	}	
	}
   else
	{
		echo "<meta http-equiv='refresh' content='0; url=login.php' />";
	}
?>
